package com.example.zhengsr.surfaceboard;

import android.util.Log;

import java.nio.file.Path;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class CommadTools {
    private static final String TAG = "CommadTools";
    private List<BaseData> mUndoData = new ArrayList<>();
    private List<BaseData> mRedoData = new ArrayList<>();
    private CommadTools(){}

    public static CommadTools create(){
        return new CommadTools();
    }

    public void undo(){
        int index = mUndoData.size() - 1;
        Log.d(TAG, "zsr undo: "+index);
        BaseData data = mUndoData.get(index);
        mUndoData.remove(index);
        mRedoData.add(data);
    }
    public void redo(){

    }
    public void add(BaseData data){
        mUndoData.add(data);
    }
    public boolean isEmpty(){
        return mUndoData.isEmpty();
    }

    public List<BaseData> getData() {
        return mUndoData;
    }
}
